package com.yimi.yinhepda.db.table;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import com.pda.ym.utils.StringUtils;
import com.yimi.yinhepda.utils.UcWaybillValidate;

/**
 * 离线托盘解绑数据库
 *
 * @author xionggaosheng
 */
@DatabaseTable(tableName = "OffLineUnbindTable")
public class OffLineUnbindTable {

    @DatabaseField(generatedId = true)
    private transient Long id;
    @DatabaseField
    private String forkliftNo;
    @DatabaseField
    private String operEmpCode;
    @DatabaseField
    private String operEmpName;
    @DatabaseField
    private String operDeptCode;
    @DatabaseField
    private String operTime;
    @DatabaseField
    private String waybillNo;
    @DatabaseField
    private String childWaybillNo;
    @DatabaseField
    private String createTime;
    /**
     * 类型，1快运，2快递
     */
    @DatabaseField
    private Integer type;

    public Integer getWaybillNoType() {
        if (waybillNo != null) {
            if (StringUtils.isWaybillNo(waybillNo)) {
                //快运单号
                return 1;
            } else if (UcWaybillValidate.validate(waybillNo)) {
                //快递单号
                return 2;
            } else {
                return null;
            }
        } else {
            return null;
        }
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getForkliftNo() {
        return forkliftNo;
    }

    public void setForkliftNo(String forkliftNo) {
        this.forkliftNo = forkliftNo;
    }

    public String getOperEmpCode() {
        return operEmpCode;
    }

    public void setOperEmpCode(String operEmpCode) {
        this.operEmpCode = operEmpCode;
    }

    public String getOperEmpName() {
        return operEmpName;
    }

    public void setOperEmpName(String operEmpName) {
        this.operEmpName = operEmpName;
    }

    public String getOperDeptCode() {
        return operDeptCode;
    }

    public void setOperDeptCode(String operDeptCode) {
        this.operDeptCode = operDeptCode;
    }

    public String getOperTime() {
        return operTime;
    }

    public void setOperTime(String operTime) {
        this.operTime = operTime;
    }

    public String getWaybillNo() {
        return waybillNo;
    }

    public void setWaybillNo(String waybillNo) {
        this.waybillNo = waybillNo;
    }

    public String getChildWaybillNo() {
        return childWaybillNo;
    }

    public void setChildWaybillNo(String childWaybillNo) {
        this.childWaybillNo = childWaybillNo;
    }
}
